/*
 *  Slider.h
 *  Fridge
 *
 *  Created by Jeremy Abel on 7/7/12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#pragma once

#include "Widget.h"
#include "Button.h"

class Slider : public Widget
{
public:
	
	Slider( Widget* pxParent );
	virtual ~Slider();
	
	virtual void	Render();
	virtual void	Update();
	
	virtual bool	CanHaveChildren() { return true; }
	
	virtual void	SetShowMinMaxLabels( const bool bShowMixMaxLabels ) { m_bShowMinMaxLabels = bShowMixMaxLabels; };
	virtual void	SetShowScaleLines  ( const bool bShowScaleLines )   { m_bShowScaleLines = bShowScaleLines; };
	
	virtual float	GetValue() { return m_fValue; };
	virtual	void	SetValue( const float fValue ) { m_fValue = fValue; };
	
protected:
	
	void	SliderButtonCallback( void* pUserData );
	
	float	m_fValue;
	float	m_fMinValue;
	float	m_fMaxValue;
	
	bool	m_bShowMinMaxLabels;
	bool	m_bShowScaleLines;
	bool	m_bMouseDownState;
	
	int		m_iMouseStartOffset;
	int		m_iSliderDragStartOffset;
	
	Button*		m_pxSliderButton;
};

//eof
